﻿namespace _030泛型_部分类_枚举_结构体_2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Student类 特化  
            Student<int> student =new Student<int>() {ID=200234,Name="lili" };
            Console.WriteLine(student.ID+student.Name);


            Student<ulong> newstudent = new Student<ulong>();
            newstudent.ID = 012;
            student.Name = "chengzi";

            NewStudent newStudent1=new NewStudent();
            newStudent1.ID = 10000;
            newStudent1.Name = "alerady ";
        }
    }

    //泛型接口
    interface IUnique<TId>
    {
        TId ID { get; set; }
    }

    //继承泛型接口也要带泛型  同时类继承后此时也是泛型 类
    class Student <TId>: IUnique<TId>
    {
        public TId ID { get; set; }
        public string Name { get; set; }
    }

    //实现特化之后的泛型接口  类再继承后不再是泛型类
    class NewStudent : IUnique<ulong>
    {
        public ulong ID { get ; set ; }
        public string Name { get; set; }
    }
}
